<template>
  <div>
      			<!-- 登录 -->
			<div class="login-wrap">
				<div class="login">
					<div class="loginform">
						<ul class="tab clearFix">
							<li>
								<a href="##" style="border-right: 0;">扫描登录</a>
							</li>
							<li>
								<a href="##" class="current">账户登录</a>
							</li>
						</ul>

						<div class="content">
							<form action="##">
								
								<div class="input-text clearFix">
									<i></i>
									<input type="text" placeholder="手机号" v-model="account.username">
									<span class="error-msg">错误提示信息</span>
								</div>

								<div class="input-text clearFix">
									<i class="pwd"></i>
									<input type="text" placeholder="请输入密码" v-model="account.password">
									<span class="error-msg">错误提示信息</span>
								</div>

								<div class="setting clearFix">
									<label class="checkbox inline">
										<input name="m1" type="checkbox" value="2" checked="">
										自动登录
									</label>
									<span class="forget">忘记密码？</span>
								</div>
								<button class="btn" type="button" @click="loginHandle">登&nbsp;&nbsp;录</button>

							</form>
							<div class="call clearFix">
								<ul>
									<li><img src="images/qq.png" alt=""></li>
									<li><img src="images/sina.png" alt=""></li>
									<li><img src="images/ali.png" alt=""></li>
									<li><img src="images/weixin.png" alt=""></li>
								</ul>
								<a href="##" class="register">立即注册</a>
							</div>
						</div>
					</div>
				</div>
			</div>
            
  </div>
</template>

<script>
export default {
    data(){
        return{
            account:{
                username:'0233200',
                password:'0233200'
            }
        }
    },
    methods:{
        loginHandle(){
            // const {username,password} = this.account
            // this.$api.reqLogin({username,password}).then(res=>{

            const account = this.account
            this.$api.reqLogin(account).then(res=>{
                if(res.code != 200){
                    alert(res.msg)
                }else{
                    this.$store.commit('saveInfo',res)
                }
            })
        }
    }

}
</script>

<style lang="less" scoped>
@import './css/index.less';

</style>